const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
const path = require('path')

module.exports = {
  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:3333',
        // target: 'http://112.74.112.76:3333',
        changeOrigin: true,
        pathRewrite: { '^/api': '' },
      },
    },
  },

  configureWebpack: {
    plugins: [
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],

    resolve: {
      //给src取别名
      alias: {
        '@': path.join(__dirname, './src'),
      },
    },
  },
}
